from django_redis import get_redis_connection
from rest_framework.status import HTTP_200_OK
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status

import logging
logger = logging.getLogger("django")

class HomeAPIView(APIView):
    def get(self, request):
        redis = get_redis_connection("sms_code")
        brother = redis.lrange("brother",0,-1)
        # brother = ["张飞","关羽","刘备"]
        return Response(brother,status=HTTP_200_OK)

